<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_2730551_8ulmf77v4r8.css">
    <link rel="stylesheet" href="../layui-v2.6.8/layui/css/layui.css">
    <style>
        .cgray {
            color: #ccc;
        }

        .cgreen {
            color: green;
        }

        .cred {
            color: red;
        }
        /* #addBtn{
            border: 0;
            outline: 0;
            color: rgb(167, 70, 90);
            background-color: rgb(44, 165, 44);
            border-radius: 10px;
            width: 90px;
            height: 20px;
            font-size: 14px; */
        /* } */

        #iconfont {
    font-size: 30px;
    color: rgb(163, 21, 21);
  }

  #iconfont1 {
    font-size: 30px;
    color: rgb(58, 62, 129);
  }

  #iconfont2 {
    font-size: 30px;
    color: rgb(42, 21, 163);
  }

  #iconfont3 {
    font-size: 30px;
    color: rgb(13, 197, 38);
  }

  #iconfont4 {
    font-size: 30px;
    color: rgb(15, 157, 223);
  }

  #iconfont5 {
    font-size: 30px;
    color: rgb(145, 223, 20);
  }

  #iconfont6 {
    font-size: 30px;
    color: rgb(238, 197, 13);
  }

  #iconfont7 {
    font-size: 30px;
    color: rgb(228, 15, 174);
  }

  #iconfont8 {
    font-size: 30px;
    color: rgb(235, 139, 13);
  }

  i {
    /* 文字跟图片对齐 */
    vertical-align: middle;
  }
    </style>
</head>

<body>
    <div class="layui-layout layui-layout-admin">
        <!-- 引入公共页面 -->
        {{include "./common/header.html" }}
    
    
        <!-- 引入公共页面 -->
        {{include "./common/side_menu.html" }}
    <!-- <h1 style="text-align: center; color: rgb(126, 27, 101);">回收站列表</h1> -->
<div style="text-align: center;padding: 10px;">
    <!-- <button id="addBtn" >  添加文章</button> -->

  
</div   >
    <div>


     
        
            <div class="layui-body">
              <!-- 内容主体区域 -->
              <div >
                <table border="1px" rules="all" style="margin: auto;" class="layui-table">
                    <tr>

                        <td><i class="iconfont icon-xuhao" id="iconfont"></i>序号</td>
            
                        <td><i class="iconfont icon-biaoti1 " id="iconfont"></i>标题</td>
                        <td><i class="iconfont icon-category01 " id="iconfont1"></i>分类</td>
                        <td><i class="iconfont icon-category01 " id="iconfont2"></i>图片</td>
                        <td><i class="iconfont icon-zuozhe " id="iconfont3"></i>作者</td>
                        <td><i class="iconfont icon-neirong " id="iconfont4"></i>内容</td>
                        <td><i class="iconfont icon-zhuangtai " id="iconfont5"></i>状态</td>
                        <td><i class="iconfont icon-shijian " id="iconfont6"></i>添加时间</td>
                        <td><i class="iconfont icon-xiugaishijian " id="iconfont7"></i>修改时间</td>
                        <td><i class="iconfont icon-caozuo " id="iconfont8"></i>操作</td>
            
                      </tr>
                    {{each myposts item index}}
                    <tr>
                        <td>{{index + 1}}</td>
                        <td>{{item.title}}</td>
                        <td>{{item.name}}</td>
                        <td><img src="/{{item.img}}" width="100px" alt=""></td>
                        <td>{{item.author}}</td>
                        <td><a href="#">查看详情</a></td>
                        <td>
                            {{@ item.status_text}}
                        </td>
                        <td>{{item.addtime | dateFormat 'YYYY-MM-DD'}}</td>
                        <td>{{item.duplicate  | dateFormat 'YYYY-MM-DD'}}</td>
                        <td>
                            <a href="/edit?id={{item.id}}" >编辑</a> |
                           <a href="javascript:;" onclick="confirmDelete('{{item.id}}');">永久删除</a>
                           <a href="/restore?id={{item.id}}" onclick="return confirm('确实加入回收站');">还原</a>
                        </td>
                    </tr>
                    {{/each}}
                </table>
              </div>
            </div>
        
         
          </div>

     
        
    </div>

</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script src="../layui-v2.6.8/layui/layui.js"></script>
<script>



    function confirmDelete(id){

       let result = layer.confirm('确认永久删除吗 数据不可以还原', {
            btn: ['是的', '取消'],
            shadeClose: true,
            shade: [0.3, '#000']
        },()=>{
            location.href="/delete?id="+id
        }, 
        ()=>{
            layer.msg('取消了',{icon:1})
        });

       
    }
</script>
</html>